﻿/*
 * ============ [ 废土 ] ============
 *
 * [ 维护者 ]  argoran@gmail.com
 * [  状态  ]  原型
 *
 * ============ [ 注释 ] ============
 *
 * 处理iplist指令的类
 *
 * ==================================
 */

using System;

using LastLand.Data.Global;

using Up2Link.Util;

namespace LastLand.Core.CmdInterpreter
{
    public class CCmdIpList : ICommandInterpreter
    {
        public void ExecuteCommand(string _cmd, string _args)
        {
            CData.console.SendOutput("");
            CIPProbe ipProbe = new CIPProbe();
            Int32 addressCount = ipProbe.AddressCount;
            if (addressCount > 0)
            {
                CData.console.SendOutput("这台机器的ip地址列表：");
                for (Int32 i = 0; i < addressCount; i++)
                {
                    CData.console.SendOutput(i + " ： " + ipProbe.AdrStrings[i]);
                }
            }
            else
            {
                CData.console.SendOutput("无法找到这台机器的ip地址");
            }
        }
    }
}
